<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <script>
        let a = [1, 2];
        console.log(a);
        a.push("abc", "defg");
        console.log(a);
        var item = a.pop();
        console.log(item);
        console.log(a);

        let b = [1,2];
        b.unshift("c", "d");
        console.log(b);
        var item1=b.shift();
        console.log(item1);

    </script>
</body>

</html>